<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/admin_template.xhtml">

    <ui:define name="body">
    	<h:form>
    		<table>
    			<tr>
    				<td>
			    		<h:commandButton value="#{messages.add_msg}" action="e_item" immediate="true"/>    		
    				</td>
    				<td align="right">
						<h:outputText value="#{kItemListManager.itemList.size}" styleClass="red" />     					
    				</td>
    			</tr>
    		</table>
    		<h:panelGroup id="a_panel_id">
	    		<rich:dataGrid id="ut_id" columns="3" value="#{kItemListManager.itemList}" var="e" elements="9" width="100%">
	    			<table width="100%">
	    				<tr>
							<td align="left" valign="top">
								<a:outputPanel id="active_">
									<a:commandLink action="#{kItemListManager.ca(e.item)}" reRender="active_" immediate="true">
				   						<h:graphicImage value="/img/#{e.item.active?'star':'star-empty'}.png" 
				   							title="#{messages.active_msg}" alt="#{messages.active_msg}" />
									</a:commandLink>
								</a:outputPanel>
							</td>
						</tr>
	    			</table>
		    			<table width="100%">
		    				<tr>
		    					<td align="center" class="b">
					               	<h:commandLink action="#{kItemListManager.edit(e.item.id)}" 
					               		title="#{messages.edit_msg}" immediate="true" >
		    							<h:outputText value="#{e.item.getName(klang)}" />
					               	</h:commandLink>
		    					</td>
		    				</tr>
		    				<tr>
		    					<td align="center" valign="middle" >
				                	<div class="ip">
						               	<h:commandLink action="#{kItemListManager.edit(e.item.id)}" 
						               		title="#{messages.edit_msg}" immediate="true" >
				    						<s:fragment rendered="#{not empty e.img.thumb}">
						                		<img src="/#{kInitParam.imgPath}/i_#{e.img.itemId}/#{e.img.thumb}" width="200px" height="200px"/>
				    						</s:fragment>
			    							<s:fragment rendered="#{empty e.img.thumb}">
				    							<h:outputText value="#{messages.no_image_available_msg}" />
				    						</s:fragment>
						               	</h:commandLink>
				                	</div>
		    					</td>
		    				</tr>
		    			</table>
	    			<f:facet name="footer">
		                <rich:datascroller for="ut_id" />
		            </f:facet>
	    		</rich:dataGrid>
    		</h:panelGroup>
    	</h:form>
    </ui:define>
</ui:composition>
